<?php

declare(strict_types=1);

namespace App\Model\Admin;

use App\Traits\Model\Admin\Role as RoleTraits;
use App\Model\Model;

/**
 * @property int $id
 * @property int $app_id 店铺ID
 * @property string $name 角色名称
 * @property string $app 应用
 * @property string $desc 描述
 * @property int $status 状态|["禁用","启用"]
 * @property int $sort 排序
 * @property \Carbon\Carbon $created_at 
 * @property \Carbon\Carbon $updated_at 
 */
class Role extends Model
{
    use RoleTraits;

    /**
     * The table associated with the model.
     */
    protected ?string $table = 'role';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ['id', 'name', 'desc', 'status', 'sort', 'app_id', 'app', 'created_at', 'updated_at'];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'app_id' => 'integer', 'status' => 'integer', 'sort' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];

    /**
     * 自动新增
     * @var array|string[]
     */
    public array $insert = [
        'app'
    ];
}
